//
//  BasicTabBatItem.m
//  j绝版新闻客户端
//
//  Created by weige on 16/5/10.
//  Copyright © 2016年 weige. All rights reserved.
//

#import "BasicTabBatItem.h"

@implementation BasicTabBatItem
+(UITabBarItem *)tabBarItemInit:(NSString *)nonformalImag andSelect:(NSString *)selectImage andTitle:(NSString *)title
{
    UITabBarItem * item=[[UITabBarItem alloc]init];

    item.image=[[UIImage imageNamed:nonformalImag]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    item.selectedImage=[[UIImage imageNamed:selectImage]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    item.title=title;
    // 字体颜色 选中
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Bold" size:12.0F], NSForegroundColorAttributeName : [UIColor redColor]} forState:UIControlStateSelected];
    
    // 字体颜色 未选中
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont systemFontOfSize:12.0F],  NSForegroundColorAttributeName:[UIColor grayColor]} forState:UIControlStateNormal];

    return item;
}
@end
